<template>
	<div>
		<div class="i_index_title">
			<span class="index_title">修改信息</span>
			<van-icon class="fanhui" size="30" @click="fanhui" name="arrow-left" />
		</div>
		<ul class="xinxi_oul">
			<li class="xinxi_oli">
				<div class="oli_title">头像</div>
				<div class="oli_right" @click="goheadimg">
					<img src="../assets/shouye/tx.png" alt="">
				</div>
			</li>
			<li class="xinxi_oli2">
				<div class="oli_title">昵称</div>
				<div class="oli_right" @click="gonickname">
					<span v-if="details.nickName==''">{{details.openId}}</span>
					<span v-if="details.nickName!=''">{{details.nickName}}</span>
					<van-icon name="arrow" />
				</div>
			</li>
		</ul>
	</div>
</template>

<script>
	export default{
		data(){
			return {
				active:0,
				details:[]
			}
		},
		created() {
			this.xinxi()
		},
		methods:{
			fanhui(){
				this.$router.go(-1);
			},
			gonickname(){
				this.$router.push('/nickname')
			},
			xinxi(){
				this.$axios.get('http://a.chuxingcai.com/prod-api/webapi/user/detail',{
					headers:{
					  token:window.sessionStorage.getItem('token')
					}
				}).then((res) => {
					console.log(res.data.data)
					this.details=res.data.data
				})
			},
			goheadimg(){
				// this.$router.push('/headimg')
			}
		}
	}
</script>

<style scoped>
	.i_index_title{
		width: 100%;
		height: 50px;
		background-color: #F74A4B;
	}
	.fanhui{
		position: absolute;
		top: 50%;
		transform: translate(0,-50%);
		color: white;
	}
	.index_title{
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%,-50%);
		color: white;
	}
	.xinxi_oul{
		width: 95%;
		border-radius: 5px;
		margin: 10px auto;
		background-color: white;
	}
	.xinxi_oli{
		width: 100%;
		height: 40px;
		border-bottom: 1px solid #eaeaea;
		position: relative;
	}
	.xinxi_oli2{
		width: 100%;
		height: 40px;
		position: relative;
	}
	.oli_title{
		position: absolute;
		top: 50%;
		left: 10px;
		font-size: 13px;
		transform: translate(0,-50%);
	}
	.oli_right{
		position: absolute;
		top: 50%;
		right: 10px;
		font-size: 13px;
		transform: translate(0,-50%);
	}
	.oli_right>span{
		font-size: 13px;
	}
	.oli_right>img{
		width: 30px;
		height: 30px;
		border-radius: 50%;
	}
</style>
